<div class="container-fluid">

  <!-- Page Heading -->
  <div class="row">
    <div class="col-lg-12">
      <h1 class="page-header">
        调度策略 <small>调度策略列表</small>
      </h1>
      <ol class="breadcrumb">
        <li class="active">
          <i class="fa fa-desktop"></i> 调度策略
        </li>
        <a href="#addScModal" role="button" style="float: right"  class="btn btn-primary" data-toggle="modal">添加策略</a>
      </ol>
    </div>
  </div>
  <!-- /.row -->

  <div class="row">

    <div class="col-lg-6">
      <div style="height: 10px"></div>
      <div class="panel panel-default">
        <div class="panel-body">
          <div class="table-responsive">
            <table id="taskTable" class="table table-bordered table-hover table-striped">
              <thead>
              <tr>
                <th class="col-lg-2">名称</th>
                <th class="col-lg-3">服务器</th>
                <th class="col-lg-2">定时策略</th>
                <th class="col-lg-1">状态</th>
                <th class="col-lg-4">操作</th>
              </tr>
              </thead>
              <tbody>
              <% if (data) { %>
              <% data.forEach(function(record,index){  if(record.sc_type=='1'){%>
              <tr>
                <td ><%-record.sc_name%></td>
                <td><%-record.sc_host%></td>
                <td><%-record.sc_time%></td>
                <td><% if(record.sc_state==1){%><a style="cursor: pointer" onclick="editState('<%=record.sc_id%>','2','<%=record.sc_type%>','<%=record.sc_task_id%>','<%=record.sc_time%>','<%=record.sc_host%>','<%=record.sc_name%>')">关闭</a> <%}else{%> <a style="cursor: pointer" onclick="editState('<%=record.sc_id%>','1','<%=record.sc_type%>','<%=record.sc_task_id%>','<%=record.sc_time%>','<%=record.sc_host%>','<%=record.sc_name%>')">开启</a> <%}%></td>
                <td uniqid="<%=record.sc_id%>">
                  <a style="cursor: pointer" onclick="edit('<%=record.sc_id%>','<%=record.sc_name%>','<%=record.sc_desc%>','<%=record.sc_type%>','<%=record.sc_task_id%>','<%=record.sc_task_name%>','<%=record.sc_host%>','<%=record.sc_time%>','<%=record.sc_state%>')" uniqid="<%=record.sc_id%>">修改</a>
                  <a style="cursor: pointer" onclick="remove(<%=record.sc_id%>)">删除</a>
                  <a style="cursor: pointer" onclick="start('<%=record.sc_id%>','<%=record.sc_host%>','<%=record.sc_type%>','<%=record.sc_task_id%>','<%=record.sc_name%>')">执行</a>
                  <a style="cursor: pointer"  onclick="getLog('<%=record.sc_id%>')">日志</a>
                </td>
              </tr>
              <% }}) %>
              <% } %>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>

    <div class="col-lg-6" style="float: right">
      <div style="height: 10px"></div>
      <div class="panel panel-default">
        <div class="panel-body">
          <div class="table-responsive">
            <table id="taskTable" class="table table-bordered table-hover table-striped">
              <thead>
              <tr>
                <th class="col-lg-2">名称</th>
                <th class="col-lg-3">服务器</th>
                <th class="col-lg-2">定时策略</th>
                <th class="col-lg-1">状态</th>
                <th class="col-lg-4">操作</th>
              </tr>
              </thead>
              <tbody>
              <% if (data) { %>
              <% data.forEach(function(record,index){ if(record.sc_type=='2'){ %>
              <tr>
                <td ><%-record.sc_name%></td>
                <td><%-record.sc_host%></td>
                <td><%-record.sc_time%></td>
                <td><% if(record.sc_state==1){%><a style="cursor: pointer" onclick="editState('<%=record.sc_id%>','2','<%=record.sc_type%>','<%=record.sc_task_id%>','<%=record.sc_time%>','<%=record.sc_host%>','<%=record.sc_name%>')">关闭</a> <%}else{%> <a style="cursor: pointer" onclick="editState('<%=record.sc_id%>','1','<%=record.sc_type%>','<%=record.sc_task_id%>','<%=record.sc_time%>','<%=record.sc_host%>','<%=record.sc_name%>')">开启</a> <%}%></td>
                <td uniqid="<%=record.sc_id%>">
                  <a style="cursor: pointer" onclick="edit('<%=record.sc_id%>','<%=record.sc_name%>','<%=record.sc_desc%>','<%=record.sc_type%>','<%=record.sc_task_id%>','<%=record.sc_task_name%>','<%=record.sc_host%>','<%=record.sc_time%>','<%=record.sc_state%>')" uniqid="<%=record.sc_id%>">修改</a>
                  <a style="cursor: pointer" onclick="remove(<%=record.sc_id%>)">删除</a>
                  <a style="cursor: pointer" onclick="start('<%=record.sc_id%>','<%=record.sc_host%>','<%=record.sc_type%>','<%=record.sc_task_id%>','<%=record.sc_name%>')">执行</a>
                  <a style="cursor: pointer" onclick="getLog('<%=record.sc_id%>')">日志</a>
                </td>
              </tr>
              <% }}) %>
              <% } %>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- /.row -->
<button onclick="sendMail()"></button>
</div>

<!-- /.container-fluid -->
<script src="/xd-autotest-framework/js/index/frame-right.js"></script>
<script src="/xd-autotest-framework/js/schedule/schedule.js"></script>

